﻿@using Abc.Application.HtAdminServices
@model Abc.Application.HtAdminServices.HtUserOut
@{
    ViewData["Title"] = "UserInfo";
}

<section class="panel panel-padding">
    <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">

        <form class="layui-form" action="" id="queryform_role">
            <input type="hidden" asp-for="Id" />
            <table class="layui-table">
                <tbody>
                    <tr>
                        <td>用户名</td>
                        <td>
                            <input asp-for="Account" lay-verify="required|account" lay-reqText="用户名不能为空！" autocomplete="off" placeholder="请输入用户名" class="layui-input">
                        </td>
                    </tr>
                    <tr>
                        <td>密码</td>
                        <td>
                            <input name="Pwd" lay-verify="pwd" autocomplete="off" placeholder="请输入密码" class="layui-input">

                        </td>
                        <td colspan="2">
                            <div style="color:red">提示：不新增或修改密码，留空即可</div>
                        </td>
                    </tr>

                    <tr>
                        <td>昵称</td>
                        <td><input asp-for="Nick" lay-verify="nick" autocomplete="off" placeholder="请输入昵称" class="layui-input"></td>
                        <td>邮箱</td>
                        <td><input asp-for="Email" autocomplete="off" placeholder="请输入邮箱" class="layui-input"></td>
                    </tr>
                    @*  <tr>
                    <td>省份</td>
                    <td><input asp-for="Province" lay-verify="province" autocomplete="off" placeholder="请输入省份" class="layui-input"></td>
                    <td>城市</td>
                    <td><input asp-for="City" lay-verify="city" autocomplete="off" placeholder="请输入城市" class="layui-input"></td>
                    </tr>
                    <tr>
                    <td>镇</td>
                    <td> <input asp-for="Town" lay-verify="town" autocomplete="off" placeholder="请输入镇" class="layui-input"></td>
                    <td>详细地址</td>
                    <td><input asp-for="Address" lay-verify="address" autocomplete="off" placeholder="请输入详细地址" class="layui-input"></td>
                    </tr>*@

                    <tr>
                        <td>办公电话</td>
                        <td><input asp-for="Tel" lay-verify="tel" autocomplete="off" placeholder="请输入办公电话" class="layui-input"></td>
                        <td>联系电话</td>
                        <td><input asp-for="Phone" autocomplete="off" placeholder="请输入联系电话" class="layui-input"></td>
                    </tr>
                    <tr>
                        <td>备注</td>
                        <td colspan="3"><textarea asp-for="Remark" lay-verify="Remark" autocomplete="off" placeholder="请输入备注" class="layui-textarea"></textarea></td>
                    </tr>
                    <tr>
                        <td colspan="4">
                            <input asp-for="IsEnable" type="checkbox" name="" title="是否启用">
                            <input asp-for="IsTest" type="checkbox" name="" title="是否测试">
                        </td>
                    </tr>
                    <tr>
                        <td>角色</td>
                        <td>
                           
                        </td>
                        <td></td>
                        <td></td>
                    </tr>
                </tbody>
            </table>

          

            <div class="layui-form-item">
                <div class="layui-input-block">
                    <div class="layui-btn submitbtn" lay-submit lay-filter="submit1">提交数据</div>
                    <div class="layui-btn layui-btn-danger closewindow">关闭窗口</div>
                    <div class="layui-btn layui-btn-danger refreshwindow">重新加载</div>
                </div>
            </div>
        </form>
    </div>
</section>
@{
    //如果需要传参数
    ViewData["id"] = 12312;
}
@* @await Html.PartialAsync("_Index",实体对象)*@
@await Html.PartialAsync("_Index",ViewData)

@*<script src="~/lib/ckeditor4/ckeditor.js"></script>*@

<script>
    layui.define(['element', 'upload', 'jquery', 'form', 'table', 'laydate'], function () {
        var $ = layui.jquery
            , upload = layui.upload,
            form = layui.form,
            table = layui.table,
            laydate = layui.laydate,
            element = layui.element;

        //Info 初始化
        abc.infoInit();
        //提交
        form.on('submit(submit1)', function (obj) {
            obj.field.IsEnable = $('#IsEnable').is(':checked');
            obj.field.IsTest = $('#IsTest').is(':checked');
            //obj.field.Remark = Remark.getContent();
            var roleids = "";
            $('input[name="role"]:checked').each(function () {
                var value = $(this).val();
                roleids += "," + value;
            });

            obj.field.RoleIds = roleids;

            abc.post({ url: '@(Url.Action("Edit"))', data: obj.field });

            return false;
        });

        //生成时间监听
        //有时间字段才有下面的代码
        // var arrDateEle = 'LastLoginTime,CreationTime,UpdateTime,DeletedTime';
        //abc.initDate('LastLoginTime,CreationTime,UpdateTime,DeletedTime');
    });
</script>

